/******************************************************************************/
/* relay_def.h                                                                */
/******************************************************************************/

#ifndef __RELAY_DEF_H
#define __relay_DEF_H


/********************** Macros & Constants for RELAY **************************/


/********************** Prototype struct for RELAY ****************************/
typedef enum
{
    eREL_1 = 1,                                    // Relay 1
    eREL_2 = 0,                                    // Relay 2
    eREL_END = 2                                   // End token
} __eIND_RELAY;                                    // Type RELAY index


#pragma pack(1)
typedef struct
{
    unsigned en_dis      : 1;
} __BIT_FLG_RELAY;


typedef union
FLG_RELAY
{
    FLG_RELAY() : relay8(0) {}

    uint8_t relay8;
    __BIT_FLG_RELAY relay;
} __FLG_RELAY;


typedef struct
SETT_RELAY
{
    SETT_RELAY() : timer(0) {}

    __FLG_RELAY relayx;
    uint8_t dummy;
    uint16_t timer;
} __SETT_RELAY;                                    // Type RELAY sett
#pragma pack()


typedef struct
TOOLS_RELAY
{
    TOOLS_RELAY() {timer[0] = 0; timer[1] = 0;}
    uint32_t timer[eREL_END];
} __TOOLS_RELAY;                                   // Type DIN sett


#endif